import { useUserStore } from '@/store'
const userStore = useUserStore()
const CarryToken = import.meta.env.VITE_REQUEST_CARRY_TOKEN
export default (config) => {
    const CarryTokenKey = import.meta.env.VITE_REQUEST_CARRY_TOKEN_POSITION_KEY
    const CarryTokenPRrefix = import.meta.env.VITE_REQUEST_CARRY_TOKEN_POSITION_VALUE_PREFIX || ''
    // 是否开启携带token请求
    if (CarryToken) {
        let token = userStore.token
        config.headers[CarryTokenKey] = `${CarryTokenPRrefix}${token}`
    }
    return config
}